1 'ERTHTWIN.BAS: A program to explore the universe to find Earth's twin. From
2 'Creative Computing November 1985 by Edward H. Carlson.
3 '
10 GOTO 1000
100 '
306 CLS:PRINT:PRINT:PRINT:PRINT
308 PRINT TAB(33)"STELLAR TYPES":PRINT
310 PRINT TAB(14)"Type Temperature Life time Mass ":PRINT
311 PRINT TAB(11)"Blue giants UV hot Very short 30 to 3"
312 PRINT TAB(11)"Transition Blue hot Short 3 to 2"
313 PRINT TAB(11)"Solar types White hot Long 2 to .5"
314 PRINT TAB(11)"Red dwarfs Red hot Very long .5 to .1"
315 PRINT:PRINT TAB(11)"Mass units = Sun's mass":PRINT
320 INPUT " Star mass";M:IF M>30 OR M<.1 THEN 320
321 RANDOMIZE M
322 L=EXP(3.5*LOG(M)):PRINT
323 TA=EXP(-2.5*LOG(M))*10000!
324 Q=10:X=L:GOSUB 900:L=X
325 Q=10:X=TA:GOSUB 900:TA=X
328 FOR J=1 TO 63:IF M>S(J) THEN 330
329 NEXT J
330 CLS:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT TAB(10)"Spectra type of star: ";S$(J):PRINT
332 PRINT TAB(10)"Luminosity of star: ";L;"times the sun's brightness":PRINT
334 PRINT TAB(10)"Lifetime of star: ";TA;"million years":PRINT
336 IF TA>12000! THEN PRINT TAB(10)"The star may be as old as the galaxy.":PRINT
338 PRINT TAB(10)"If there is a planetary system:":PRINT
340 IF TA<100 THEN PRINT T$(0):GOTO 350
342 IF TA<700 THEN PRINT T$(1):GOTO 350
344 IF TA<2000 THEN PRINT T$(2):GOTO 350
346 IF TA<4100 THEN PRINT T$(3):GOTO 350
348 :PRINT T$(4)
350 PRINT:PRINT TAB(10)"Do you want to investigate this star (Y/N)?"
352 Y$=INKEY$:IF Y$="" THEN X=RND(9):GOTO 352
354 IF Y$="y" OR Y$="Y" THEN GOSUB 400
355 END
400 CLS:PRINT:PRINT
404 SA=RND(9)*TA:IF SA>13000 THEN SA=13000
405 Q=10:X=SA:GOSUB 900:SA=X
406 PRINT TAB(16)"We find the system is";SA;"million years old."
407 PRINT:PRINT TAB(16)"(Solar system age = 4550 million years.)"
408 IF SA=13000 THEN PRINT:PRINT TAB(16)"Population II star, low in heavy elements."
409 PRINT
410 '
411 NP=6+INT(RND(9)*5)
412 SC=.3*SQR(M)*(.9+RND(9)*.2)*8/NP
414 A=SC
420 FOR I=1 TO NP
423 A=A*1.7*(.8+RND(9)*.4)
425 T(I)=SQR(A^3/M)
427 E(I)=.01*RND(9)*9
430 '
432 AC=4*L*L
434 A2=A^2
435 MC=M*1*(.3+RND(9)*1.4)*A2
436 MC=MC*.3^(A/4):MP=MC
437 IF A>AC THEN MP=MC*12
438 IF MP>3 THEN MP=MP^1.5
439 IF MP>999 THEN MP=MP/2:GOTO 439
440 IF MP<.01 THEN MP=.01
442 '
444 :C$(I)="rocky"
446 IF A>AC THEN C$(I)="icey"
448 IF MP>3 THEN C$(I)="gaseous"
450 '
451 R=MC^.33
452 IF MP<>MC THEN R=(MP*5)^.33
454 '
456 SG=MP/R/R
458 MP(I)=MP:A(I)=A:R(I)=R:SG(I)=SG
460 '
462 IF MP<2 THEN NM(I)=INT(RND(9)+.6):GOTO 490
464 IF MP>2 THEN NM(I)=INT((5.6*RND(9))+RND(9)*5*LOG(MP))
490 NEXT I
500 '
520 FOR I=1 TO NP
524 TI(I)=.1*RND(9)*3
526 D(I)=1
528 ST(I)=290*SQR(SQR(L)/A(I))
530 IF ST(I)>173 AND C$(I)="icey" THEN MP(I)=MP(I)/12:C$(I)="rocky"
532 IF ST(I)>2000 THEN MP(I)=0:C$(I)="evaporated"
538 NEXT I:GOSUB 700
550 '
599 RETURN
600 '
700 '
712 PRINT TAB(32)"PLANETS":PRINT
716 PRINT" orbit period mass surface surf. composition moons"
718 PRINT" # radius gravity temp.":PRINT
730 FOR I=1 TO NP
732 Q=10:X=A(I):GOSUB 900:A(I)=X
734 Q=10:X=SG(I):GOSUB 900:SG(I)=X
736 Q=10:X=MP(I):GOSUB 900:MP(I)=X
738 Q=10:X=ST(I):GOSUB 900:ST(I)=X-270
740 Q=10:X=T(I):GOSUB 900:T(I)=X
742 PRINT I;TAB(6):IF C$(I)="evaporated" THEN PRINT C$(I):GOTO 770
744 PRINT USING "###.##";A(I);
746 PRINT TAB(15);
748 PRINT T(I);
750 PRINT TAB(24);
752 PRINT USING "###.##";MP(I);
754 PRINT TAB(31);
756 PRINT USING "###.##";SG(I);
758 PRINT TAB(41);
760 PRINT USING "####.";ST(I);
762 PRINT TAB(51);
764 PRINT C$(I);
766 PRINT TAB(61);
768 PRINT NM(I)
770 NEXT I
772 PRINT:PRINT "units: AU years earth's earth's C"
799 PRINT:INPUT" Do you want to investigate another star (Y/N)";A$
800 IF A$="Y" OR A$="y" THEN GOTO 100
801 IF A$="N" OR A$="n" THEN PRINT:PRINT TAB(20)"Returning you to Earth, enjoy the voyage!"
900 '
906 IF X=0 THEN RETURN
910 N=0:IF X<2*Q THEN 930
914 :IF X>=20*Q THEN X=X/10:N=N+1:GOTO 914
918 X=INT(X+.5):IF N=0 THEN RETURN
920 FOR K=1 TO N:X=X*10:NEXT K:RETURN
930 :IF X<2*Q THEN X=X*10:N=N+1:GOTO 930
934 X=INT(X+.5):IF N=0 THEN RETURN
936 FOR K=1 TO N:X=X/10:NEXT K:RETURN
1000 '
1020 CLS:PRINT:PRINT:PRINT TAB(22)"THE EARTH'S TWIN -- AN ASTRONOMY GAME":PRINT:PRINT
1030 PRINT"GAME OBJECTIVE: Come search the galaxy for a twin planet to Earth--one we can"
1031 PRINT"colonize. Pick a nearby star that has a desirable mass.":PRINT
1032 PRINT"GAME PURPOSE: This program will show the relationship between the mass and"
1033 PRINT"lifetime of a star, how narrow the zone of habitability is around a star, and"
1034 PRINT"planetary orbital parameters in relation to the mass of the parent star.":PRINT
1090 PRINT"NOTICE: Due to a strange bug in the way the program handles the randomizing"
1091 PRINT"function, sometimes our galactic voyage navigates a little too close to a black"
1092 PRINT"hole which sucks the quarks out of the warp drive engines. This will terminate"
1093 PRINT"the program. If this happens, sack the navigator, reboot the program, and we"
1094 PRINT"catch the next starship out!":PRINT:PRINT
1095 PRINT TAB(25)"Created by Edward H. Carlson":PRINT
1096 PRINT TAB(20)"Modified for ATARI ST by Robert Reeves":PRINT
1100 PRINT TAB(23)"Press the Space Bar to continue."
1110 Y$=INKEY$:IF Y$<>" " THEN X=RND(9):GOTO 1110
1999 PRINT" Wait"
2000 '
2120 DIM ST(20),S(65),S$(65)
2160 DATA 30,26,23,19.9,17.3,15.1,13.2,11.5,10,8.4,7.1,6,5,4.2,3.6,3,2.9,2.7,2.6,2.5,2.3
2161 DATA 2.2,2.1,2,1.91,1.82,1.73,1.65,1.57,1.49,1.42,1.35,1.28,1.22,1.16,1.11,1.05,1,.95,.9,.85,.81,.77,.73,.69,.66,.62,.59,.56,.53,.51,.48,.46,.43,.41
2162 DATA .39,.37,.35,.33,.25,.183,.135,.1
2165 DATA O5,O6,O7,O8,O9,B0,B1,B2,B3,B4,B5,B6,B7,B8,B9,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,F0,F1,F2,F3,F4,F5,F6,F7,F8,F9,G0,G1,G2,G3,G4,G5,G6,G7,G8,G9
2166 DATA K0,K1,K2,K3,K4,K5,K6,K7,K8,K9,M0,M1,M2,M3,M4,M5,M6,M7
2168 :FOR J=1 TO 63:READ S(J):NEXT J
2169 :FOR J=1 TO 63:READ S$(J):NEXT J
2180 T$(0)=" The star may explode in the near future!"
2181 T$(1)=" The system is too young for life to have developed."
2182 T$(2)=" There may be unicellular life, but no oxygen on any planets."
2183 T$(3)=" There may be oxygen and lower lifeforms present."
2184 T$(4)=" There may be higher lifeforms on some planets."